def check_symbols(word_1, word_2):
    if (word_1[-1] == "ь"):
        return word_1[-2] == word_2[0]
    return word_1[-1] == word_2[0]
        

assert check_symbols("москва", "рязань") is False
assert check_symbols("ишим", "мурманск") is True
assert check_symbols("севастополь", "тюмень") is False
assert check_symbols("тюмень", "нижневартовск") is True